package com.water.camera.mark;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.water.camera.bean.EditItem;
import com.water.camera.databinding.Time5Binding;

import java.util.ArrayList;

public class Mark98 extends BaseMark {

    Time5Binding binding;

    public Mark98(@NonNull Context context) {
        super(context);
    }

    public Mark98(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public Mark98(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void init(int type) {
        if (type == 0) {
            binding = Time5Binding.inflate(LayoutInflater.from(getContext()));
            addView(binding.getRoot());
        } else {
            binding = Time5Binding.inflate(LayoutInflater.from(getContext()), this, true);
        }
        update();
    }

    @Override
    public void update() {
        setText(binding.tv, "title98", binding.tv);
        setText(binding.loc, "didian98", binding.loc);

        super.update();
    }

    @Override
    public ArrayList<EditItem> getEditItems() {
        ArrayList<EditItem> list = new ArrayList<>();
        list.add(new EditItem("title98", "标题"));
        list.add(new EditItem("didian98", "地点"));

        return list;
    }
}
